<template>
  <view>
    <view class="activity-box" @click="goSearchActivity(item.id)">
      <view class="activity-main">
        <view class="image">
          <image :src="item.imageUrl" mode=""></image>
        </view>
        <view class="activity-Info">
          <view class="activity-title">
            {{item.eventName}}
          </view>
          <view class="activity-status">
            {{item.status}}
          </view>
          <view class="activity-cate">
            {{item.eventType}}
          </view>
        </view>
      </view>
      <view class="activity-footer">
        <view class="activity-participantCount">
          可报名人数：{{item.participantCount}}
        </view>
        <view class="activity-time">
          {{item.eventDate}}
        </view>
      </view>
    </view>
  </view>
</template>
<script>
  export default {
    props: {
      item: Object,
    },
    data() {
      return {

      }
    },
    methods: {
      goSearchActivity(id) {
        uni.navigateTo({
          url: '/subpkg/activityDetail/activityDetail?id='+id
        })
      }
    }
  }
</script>
<style lang="scss">
  .activity-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 90%;
    height: 300rpx;
    margin: 0 auto;
    margin-top: 30rpx;
    padding: 30rpx;
    border-radius: 20rpx;
    box-shadow: 0 5rpx 20rpx #ddd;

    .activity-main {
      display: flex;

      .image {
        width: 200rpx;
        height: 200rpx;
        border-radius: 20rpx;
        overflow: hidden;

        image {
          width: 100%;
          height: 100%;
        }
      }

      .activity-Info {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 450rpx;
        margin-left: 30rpx;

        .activity-title {
          font-size: 36rpx;
          font-weight: 700;
        }

        .activity-status {
          font-size: 28rpx;
          color: #999;
        }

        .activity-cate {
          width: fit-content;
          padding: 5rpx 10rpx;
          font-size: 26rpx;
          background-color: #b6eaae;
          color: #fff;
        }
      }
    }

    .activity-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 20rpx;
      border-top: 1rpx solid #eee;

      .activity-participantCount,
      .activity-time {
        width: fit-content;
        height: 100%;
        font-size: 28rpx;
        color: #666;
      }
    }
  }
</style>